package com.wrupple.muba.desktop.domain;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;

import com.wrupple.muba.common.domain.RawSlice;
import com.wrupple.muba.desktop.client.module.ModuleController.ModuleConfiguration;

public class DesktopDescriptor implements Serializable, ModuleConfiguration {
	private static final long serialVersionUID = 8907558091769601013L;
	/**
	 * All of the loadable slices in the world
	 */
	private HashMap<String, RawSlice> slices;
	private HashMap<String, String> properties;
	/**
	 * The user readable name of the application using the desktop
	 */
	private String applicationName;
	private String userDetails;

	/**
	 * Creates a new instance of a DesktopDescriptor with no items initialized
	 */
	public DesktopDescriptor() {
		super();
		properties = new HashMap<String, String>();
	}



	/**
	 * @return All the unconfigured Slices declared for the Desktop
	 */
	public Collection<RawSlice> getRawSlices() {
		return this.slices.values();
	}


	/**
	 * @return The names of all the slices in this desktop
	 */
	public Set<String> getSilceNames() {
		return this.slices.keySet();
	}

	/**
	 * @return the slices
	 */
	public HashMap<String, RawSlice> getSlices() {
		return slices;
	}


	/**
	 * @param slices
	 *            the slices to set
	 */
	public void setSlices(HashMap<String, RawSlice> slices) {
		this.slices = slices;
	}

	public String getApplicationName() {
		return applicationName;
	}

	public void setApplicationName(String name) {
		this.applicationName = name;
	}

	public void setUserDetails(String details) {
		this.userDetails = details;
	}

	public String getUserDetails() {
		return this.userDetails;
	}

	public void addProperty(String string, String value) {
		this.properties.put(string, value);
	}

	public HashMap<String, String> getProperties() {
		return properties;
	}

	public void setProperties(HashMap<String, String> properties) {
		this.properties = properties;
	}


}
